#ifndef COMMUNICATION_H
#define COMMUNICATION_H

#include <QString>
#include <QStringList>

#define SERVER_IPADDR "192.168.1.1"

enum SERVICE_CODE
{
    LOGIN_CODE,
    REG_CODE,
    MOD_CODE,
    QUERY_CODE,
    PURCHASE_CODE,
    HISTTORY_CODE,
    CANCELL_CODE,
    ERRO_CODE
};

class Text
{
private:
    QString t;
    SERVICE_CODE service;

public:
    Text(){}
    Text(QString);
    char* toString();
    void add(QString);
    int length();
    QStringList toStringList();
    void setType(SERVICE_CODE sc);
    SERVICE_CODE getType();
};


#endif // COMMUNICATION_H
